package com.it.elmboot.controller;

import com.it.elmboot.pojo.Food;
import com.it.elmboot.service.FoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/food")
public class FoodController {
    @Autowired
    FoodService foodService;
    @GetMapping("/getFoodByBusinessId")
    @ResponseBody
    public ResponseEntity<Object> getFoodByBusinessId(Integer businessId) {
//        System.out.println(businessId);
        return new ResponseEntity<>(foodService.getFoodByBusinessId(businessId), HttpStatus.OK);
//        return null;
    }
}
